package util;

public class Print {
	
	/**
	 * For those who are tired of writing "System.out.println"
	 * @param s String to be printed to stdout
	 */
	public static void string(String s) {
		System.out.println(s);
	}

	/**
	 * Prints a textual representation of an integer array
	 * @param a the int array to be printed
	 */
	public static void array(int[] a) {
		String s = "[";
		for(int i=0; i<a.length-1; i++) {
			s += a[i]+", ";
		}
		if(a.length>0) {
			s += a[a.length-1];
		}
		s += "]";
		Print.string(s);
	}

	/**
	 * Prints a textual representation of a string array
	 * @param a the String array to be printed
	 */
	public static void array(String[] a) {
		String s = "[";
		for(int i=0; i<a.length-1; i++) {
			s += a[i]+", ";
		}
		if(a.length>0) {
			s += a[a.length-1];
		}
		s += "]";
		Print.string(s);
	}
	
}
